package com.lqg.bookLibrary.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author prodigal_lqg
 * @since 2023-04-09 
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("collect")
public class Collect implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 收藏夹id
     */
    @TableId("collect_id")
    private Long collectId;

    /**
     * 收藏夹用户id
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 收藏夹图书id
     */
    @TableField("book_id")
    private Long bookId;

    /**
     * 收藏夹创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * 收藏夹更新时间
     */
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;


    public Collect(Long userId, Long bookId) {
        this.userId = userId;
        this.bookId = bookId;
    }
}
